<?php

 /**
  * @package JooS
  * @subpackage Syntax
  */

  require_once "JooS/Syntax/Simple.php";

 /**
  * Digit ::= ? [0-9] ?;
  **/
  class JooS_Syntax_Simple_Digit extends JooS_Syntax_Simple {
    public function init() {
    }

    /**
     * @return int
     */
    public function getLength() {
      return 1;
    }

    /**
     * @param string $substring
     * @return bool
     */
    public function checkSubstring($substring) {
      $ord = ord($substring);
      return $ord >= 48 && $ord <= 57;
    }
  }
